#!/bin/bash

DST=proxy_client
function main {
	while true
	do
		count=`ps aux|grep ${DST}|grep -v "grep"|wc -l`
		if [[ ${count} > 0 ]]
		then
			echo "${DST} is alive"
			sleep 10
			continue
		fi

		echo "${DST} is stop and restart it"
		./${DST} &
	done

}


main $*
exit 0
